package com.ipet.app.ui.fragment;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.github.clans.fab.FloatingActionButton;
import com.ipet.app.R;
import com.ipet.app.adapter.MyAdapter;
import com.ipet.app.ui.base.BaseFragment;


/**
 * Created by jindongping on 16/3/8.
 */
public class TestFragment extends BaseFragment {


    public static TestFragment newInstance() {
        TestFragment fragment = new TestFragment();
        Bundle bundle = new Bundle();
        fragment.setArguments(bundle);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.view_recyclerview, null);
        RecyclerView mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
        //创建默认的线性LayoutManager
        RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
        mRecyclerView.setLayoutManager(mLayoutManager);
        //创建并设置Adapter
        MyAdapter mAdapter = new MyAdapter();
        mRecyclerView.setAdapter(mAdapter);
        return view;
    }


}
